package com.fast.admin.service.sys.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fast.admin.entity.sys.UserRole;
import com.fast.admin.mapper.sys.IUserRoleMapper;
import com.fast.admin.service.sys.IUserRoleService;
import com.fast.common.base.service.impl.BaseService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title：UserRoleService
 * @author：ylc
 * @date：2018/8/3 16:28
 * @version：1.0
 **/
@Service
public class UserRoleService extends BaseService<IUserRoleMapper, UserRole> implements IUserRoleService {
    @Override
    public List<UserRole> selectByUserId(Long userId) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("user_id", userId);
        return super.selectList(wrapper);
    }

    @Override
    public List<UserRole> selectByRoleId(Long roleId) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("role_id", roleId);
        return super.selectList(wrapper);
    }
}
